import { listAllData, findById, findAllDictName, getUserByOrgId, update, insertOfficeInfo, exportData } from '@/services/treatmentListApi';

export default {
  namespace: 'treatmentList',

  state: {

  },

  effects: {
    /**
    * 分页
    * @param payload
    * @param call
    * @param put
    * @returns {Generator<*, *, *>}
    */
    *listAllData({ payload }, { call, put }) {
      const response = yield call(listAllData, payload);
      return response;
    },

    /**
   * 详情
  * */
    *findById({ payload }, { call, put }) {
      const response = yield call(findById, payload);
      return response;
    },

    /**
   * 字典
  * */
    *findAllDictName({ payload }, { call, put }) {
      const response = yield call(findAllDictName, payload);
      return response;
    },
    /**
    * 机构下人员
   * */
    *getUserByOrgId({ payload }, { call, put }) {
      const response = yield call(getUserByOrgId, payload);
      return response;
    },
    /**
      * 编辑保存
     * */
    *update({ payload }, { call, put }) {
      const response = yield call(update, payload);
      return response;
    },

    /**
     * 存入正式库
    * */
    *insertOfficeInfo({ payload }, { call, put }) {
      const response = yield call(insertOfficeInfo, payload);
      return response;
    },

    
    /**
     * 点击导出列表信息
     * @param payload
     * @param call
     * @param put
     * @returns {Generator<*, *, *>}
     */
    *exportData({ payload }, { call, put }) {
      const response = yield call(exportData, payload);
      return response;
    },







  },

  reducers: {


  },
};

